﻿using System;
using System.Data;
using System.Web;
using System.Collections;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.ComponentModel;

namespace ClientTools.Server.Webservices
{
    /// <summary>
    /// Zusammenfassungsbeschreibung für ClientToolsPackagerService
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [ToolboxItem(false)]
    public class ClientToolsPackageService : ClientToolsBaseService
    {

        [WebMethod]
        public Library.Macros.MacroCollection GetMacros(string userName, string password)
        {
            base.Authenticate(userName, password, ServiceTypeEnum.PackageService);
            return new Library.Packager.PackageManager().GetMacros();
        }

        [WebMethod]
        public Library.Templates.TemplateCollection GetTemplates(string userName, string password)
        {
            base.Authenticate(userName, password, ServiceTypeEnum.PackageService);
            return new Library.Packager.PackageManager().GetTemplates();
        }

        [WebMethod]
        public Library.DocumentTypes.DocumentTypeCollection GetDocumentTypes(string userName, string password)
        {
            base.Authenticate(userName, password, ServiceTypeEnum.PackageService);
            Library.DocumentTypes.DocumentTypeCollection col = new Library.Packager.PackageManager().GetDocumentTypes();
            umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, 0, "GetDocumentTypes ENDE: " + col.Count.ToString());
            return col;
        }
    }
}
